<%--
  Created by IntelliJ IDEA.
  User: dj
  Date: 2018-09-13
  Time: 6:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%@ include file="/common/baseMeta.jsp" %>
    <title>疑似病例条件组合</title>

    <script type="text/javascript">
        $(function() {
            var height = findDimensions_height();
            $("#l_datagrid").height(height - 50);
            $("#r_datagrid").height(height - 50);
			initl_datagrid();
			initr_datagrid();
            Getl_datagrid();
        })
		
		function Getl_datagrid()
		{
			$.getJSON("/commapiV2", {
                p_dm: "Y_YSZH_Get",
				zhname:$("#zhname").val()
            }, function (data) {
                if (data.success) {
                    var griddata = {};
                    griddata.rows = data.Table;
                    griddata.total = data.totalcount;
                    $('#l_datagrid').datagrid('loadData', griddata);
					$("#l_datagrid").datagrid("selectRow", 0);
                }
            }, true);
		}
		function Getr_datagrid(strmid)
		{ 
			var row = $('#l_datagrid').datagrid('getSelected');
			$.getJSON("/commapiV2", {
                p_dm: "Y_yszhtj_Get",
				mid: strmid
            }, function (data) {
                if (data.success) {
                    var griddata = {};
                    griddata.rows = data.Table;
                    griddata.total = data.totalcount;
                    $('#r_datagrid').datagrid('loadData', griddata);
                }
            }, true);
		}
		function initl_datagrid() {
            $('#l_datagrid').datagrid({
                fit: false, //自动适屏功能
                rownumbers: true,//显示行号
                singleSelect: true,//只显示一行
                pagination: true,//启用分页
                remoteSort: false,
                clientPaging: false,
                fitColumns: true,
                sortable: true, //启用排序列
                collapsible: true,
                idField: 'id',
                pageSize: 50,
                pageList: [50, 150, 200],
                columns: [
                    [
                        {field: 'id', title: '编号', hidden: true},
                        {field: 'xh', title: '序号', width: '60px', align: 'center'},
                        {field: 'ZHName', title: '组合名称', width: '180px', align: 'center'}
                    ]
                ],
				onClickRow: function (index, field, value) {
                    var row = $('#l_datagrid').datagrid('getSelected');
					Getr_datagrid(row.id); 
                }
            }).datagrid('clientPaging');
        }
		function initr_datagrid() {
            $('#r_datagrid').datagrid({
                fit: false, //自动适屏功能
                rownumbers: true,//显示行号
                singleSelect: true,//只显示一行
                pagination: true,//启用分页
                remoteSort: false,
                clientPaging: false,
                fitColumns: true,
                sortable: true, //启用排序列
                collapsible: true,
                idField: 'id',
                pageSize: 50,
                pageList: [50, 150, 200],
                columns: [
                    [
                        {field: 'id', title: '编号', hidden: true},
                        {field: 'zhname', title: '序号', width: '180px', align: 'center'},
                        {field: 'tjName', title: '组合名称', width: '180px', align: 'center'},
                        {field: 'tjlx', title: '条件名称', width: '180px', align: 'center'}
                    ]
                ]
            }).datagrid('clientPaging');
        }
		function Addtj()
		{  
            var url = "/FormApi?mobanId=364d7704-6923-4e99-837f-32b149676fcf";
            layeropen(800, 600, "添加组合条件", url);
		}
		 function Edite() {
            var row = $('#l_datagrid').datagrid('getSelected'); 
            var url = "/FormApi?mobanId=364d7704-6923-4e99-837f-32b149676fcf&dataId="+row.id;
            layeropen(800, 600, "数据编辑", url);
        }
    function loadList(){
        Getl_datagrid();
	}
    </script>
</head>
<body>
<div style="margin:0 5px; overflow: hidden;"> 
    <div class="navheader form-inline" style="height:40px;margin-bottom: 0px;">
        <div class=" form-group">
            <label for="ZYNumber" style="padding:5px 10px 0 20px;">组合条件名称</label>
            <input type="text" class="form-control" style="width:100px;" name="zhname" id="zhname"
                   placeholder="条件名称"/>
			<button type="button" class="btn btn-success bi-btn-search" onclick="Getl_datagrid()">
                <span class="glyphicon glyphicon glyphicon-search"></span>
            </button>
        </div>
		<div class="btn-group-right">
            <div class="btn-group" role="group">
                <button type="button" class="btn btn-default bi-btn-width90" onclick="Addtj()">添加</button>
                <button type="button" class="btn btn-default bi-btn-width90" onclick="Edite()">编辑</button>
            </div>
        </div>
    </div>

</div>

<div style="margin:0 5px; overflow: hidden; ">
    <!--左边表格-->
    <div style="width:30%;float:left;display:inline-block;padding-right:5px;border-right:1px dotted #ccc;">
        <table id="l_datagrid" class="datagrid"></table>

    </div>
    <!--右边表格 -->
    <div style="width:70%;float:right;display:inline-block;padding-left:5px;">
        <table id="r_datagrid" class="datagrid"></table>
    </div>
</div>

</body>
</html>
